import './shim'

import React,{Component} from 'react'
import { render } from 'react-dom'
import { Router, Route, hashHistory, IndexRoute } from 'react-router'
import App from './src/App'
import About from './src/bll/About/About'
import Skill from './src/bll/SKill/Skill'
import Hobby from './src/bll/Hobby/Hobby'
import Home from './src/bll/Home/Home' 

import $ from 'jQuery' 

class Root extends Component{
    backTop= ()=> {
        $('body,html').animate({scrollTop:0},300); 
    } 
    render() {
        return(
            <Router history={hashHistory}>
                <Route path="/" component={App}>
                    <IndexRoute onEnter={this.backTop} component={Home}/>
                    <Route path="/skill" onEnter={this.backTop} component={Skill}/>
                    <Route path="/about" onEnter={this.backTop} component={About}/>
                    <Route path="/hobby" onEnter={this.backTop} component={Hobby}/>
                </Route>
            </Router>
        )
    }
}





{/*
render((
    <Router history={hashHistory}>
        <Route path="/" component={App}>
            <IndexRoute onEnter={backTop} component={Home}/>
            <Route path="/skill" onEnter={backTop} component={Skill}/>
            <Route path="/about" onEnter={backTop} component={About}/>
            <Route path="/hobby" onEnter={backTop} component={Hobby}/>
        </Route>
    </Router>
), document.getElementById('app'))
 */}
 
render(
    <Root/>,
    document.getElementById('app')
)